﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project
{
    public partial class Fxtian : Form
    {
        public Fxtian()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string name = this.textBox2.Text;
            string  count = this.textBox1.Text;
            int s = Convert.ToInt32(count);
            string money = this.textBox3.Text;
            decimal b = Convert.ToDecimal(money);
            if(string.IsNullOrEmpty(name))
            {
                MessageBox.Show("请填写完整");
            }
            string sql = string.Format("insert into Room values('{0}',{1},{2})",name,s,b);
            int result = FrmHotel.DBHelper.ExecuteUpdate(sql);
            if (result > 0)
            {
                MessageBox.Show("添加成功");
                this.Close();
            }
            else 
            {
                MessageBox.Show("添加失败");
            }
        }
     
    }
}
